package Test;

import com.config.MyBatisConfig;
import com.config.SpringConfig;
import com.domain.BookAndComments;
import com.mapper.BookAndCommentsMapper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.List;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes={SpringConfig.class, MyBatisConfig.class})
public class BookAndCommentsMapperTest {

    @Autowired
    private BookAndCommentsMapper bookAndCommentsMapper;

    @Test
    public void selectAllTest(){
        List<BookAndComments> bookAndCommentsList=bookAndCommentsMapper.selectAll();
        System.out.println(bookAndCommentsList);
    }
}
